<?php

include($_SERVER['DOCUMENT_ROOT']. '/fatec-si/authenticate/Authenticator.php');


class Authorization {
	
	private $config = array ("admin" => array ("adminAdvogado.php") , "advogado" => array ("gerenteSecretario.php"));
	

	public function authorize ($page){
		$user = Authenticator::getUser();
		if (!in_array ($page,$this->config[$user->tipo_usuario_nome])){
			die ("fail");
		}else{
			die ("OK");
		}
	}

}

?>